Skip to content

feat(lastcode): add Codex thread tools - #52

Merged
lastobelus merged 23 commits into
lastcode/mainfrom
lastcode/codex-thread-tools
Aug 24, 2026
Merged

feat(lastcode): add Codex thread tools#52
lastobelus merged 23 commits into
lastcode/mainfrom
lastcode/codex-thread-tools

Conversation

@lastobelus

@lastobelus lastobelus commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Problem

Codex can already discover and inspect LastCode/T3 Code sessions by probing environment variables and SQLite, but that path is unofficial, inconsistent, and awkward across hosts. A single user running a handful of concurrent threads needs a small supported command surface for identifying, listing, reading, messaging, and waiting on those threads.

Implemented

This umbrella contains all three reviewed slices:

  1. #54 adds Codex-only current, list, and read commands plus the generated lastcode-thread launcher. Reads prefer the authenticated live server and use a bounded, read-only SQLite fallback.
  2. #59 adds live-only, fire-and-forget send.
  3. #61 adds exact send --wait correlation and standalone wait, with bounded answers and recovery handles.

Codex receives authoritative LastCode and provider thread identity. Cross-host use deliberately composes the same command over SSH. Durable usage documentation is in docs/user/codex-thread-tools.md.

Scope

This remains a personal, low-concurrency tool. It does not add an MCP server, broker, host registry, UI, generic retry framework, or general-purpose orchestrator. If the provider accepts a turn but the process dies, correlation finalization fails, the assistant-finalization marker cannot be persisted before the durable link is recorded, or a checkpoint revert removes the tracked turn, that wait handle can time out; automatic retry and reconciliation are intentionally deferred.

Validation

  • Each slice passed focused tests, package typechecks, lint, formatting, bounded Luna-high review rounds, and exact-head Codex review before being merged into this umbrella.
  • The rebased patch is identical across all 16 feature commits and contains only 42 thread-tools files.
  • The exact current head 6c618fa9d passed 224 focused tests and the guarded quick local CI gate on base 0b0bca08e, including all workspace tests and typechecks and 2,749 passing server tests.
  • Exact-head Codex review reported no major issues, and every review thread is resolved.

Do not merge this umbrella PR into lastcode/main until the user explicitly rubberstamps it.

Implemented by GPT-5.6 Sol, reviewed with GPT-5.6 Luna, in the T3 Code Codex harness.

lastobelus added a commit that referenced this pull request Aug 22, 2026
## Problem

Codex can infer LastCode session identity by probing environment
variables and SQLite, but there is no supported, bounded way to
identify, list, or inspect threads—especially when composing the same
operation over SSH.

## Solution

- add `t3 thread current|list|read` with stable, bounded JSON output;
- materialize a home-pinned `lastcode-thread` wrapper and expose it only
to Codex processes on supported POSIX hosts;
- inject authoritative LastCode thread/home identity and preserve
Codex's provider-native thread identity in the session projection;
- use least-privilege authenticated live reads with a bounded offline
projection fallback;
- document explicit local-first/SSH composition without adding host
discovery, MCP, or a broker.

This PR is slice 1 of umbrella PR #52. It intentionally contains no
thread messaging or waiting behavior.

## Validation

- five bounded Luna-high review rounds; final correctness, KISS, and
best-practices results are clean;
- 231 focused tests passed;
- focused lint and server/contracts typechecks passed;
- repository pre-push quick CI passed: formatting, workspace typechecks,
and all workspace tests.

Implemented with GPT-5.6 Sol and reviewed with GPT-5.6 Luna in the Codex
harness.
lastobelus added a commit that referenced this pull request Aug 22, 2026
## Problem

Codex can infer LastCode session identity by probing environment
variables and SQLite, but there is no supported, bounded way to
identify, list, or inspect threads—especially when composing the same
operation over SSH.

## Solution

- add `t3 thread current|list|read` with stable, bounded JSON output;
- materialize a home-pinned `lastcode-thread` wrapper and expose it only
to Codex processes on supported POSIX hosts;
- inject authoritative LastCode thread/home identity and preserve
Codex's provider-native thread identity in the session projection;
- use least-privilege authenticated live reads with a bounded offline
projection fallback;
- document explicit local-first/SSH composition without adding host
discovery, MCP, or a broker.

This PR is slice 1 of umbrella PR #52. It intentionally contains no
thread messaging or waiting behavior.

## Validation

- five bounded Luna-high review rounds; final correctness, KISS, and
best-practices results are clean;
- 231 focused tests passed;
- focused lint and server/contracts typechecks passed;
- repository pre-push quick CI passed: formatting, workspace typechecks,
and all workspace tests.

Implemented with GPT-5.6 Sol and reviewed with GPT-5.6 Luna in the Codex
harness.
@lastobelus
lastobelus force-pushed the lastcode/codex-thread-tools branch from ab28c98 to 0fb7a4f Compare August 22, 2026 09:37
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fb7a4faba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/http.ts Outdated
Comment thread docs/lastcode/codex-thread-tools-plan.md Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c31c6c0468

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e8193c926

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
lastobelus added a commit that referenced this pull request Aug 22, 2026
## Problem

Codex can infer LastCode session identity by probing environment
variables and SQLite, but there is no supported, bounded way to
identify, list, or inspect threads—especially when composing the same
operation over SSH.

## Solution

- add `t3 thread current|list|read` with stable, bounded JSON output;
- materialize a home-pinned `lastcode-thread` wrapper and expose it only
to Codex processes on supported POSIX hosts;
- inject authoritative LastCode thread/home identity and preserve
Codex's provider-native thread identity in the session projection;
- use least-privilege authenticated live reads with a bounded offline
projection fallback;
- document explicit local-first/SSH composition without adding host
discovery, MCP, or a broker.

This PR is slice 1 of umbrella PR #52. It intentionally contains no
thread messaging or waiting behavior.

## Validation

- five bounded Luna-high review rounds; final correctness, KISS, and
best-practices results are clean;
- 231 focused tests passed;
- focused lint and server/contracts typechecks passed;
- repository pre-push quick CI passed: formatting, workspace typechecks,
and all workspace tests.

Implemented with GPT-5.6 Sol and reviewed with GPT-5.6 Luna in the Codex
harness.
@lastobelus
lastobelus force-pushed the lastcode/codex-thread-tools branch from 0e8193c to 91e5265 Compare August 22, 2026 10:08
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91e5265c38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9792eb0729

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13f76f2a96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 346c4aca92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c88062c541

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts Outdated
Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba35113681

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bb1592c42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ecb2d0421f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus
lastobelus force-pushed the lastcode/codex-thread-tools branch from fe3dc95 to 8bd2842 Compare August 24, 2026 07:37
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bd28429c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/updateDrain/UpdateDrainAdmission.ts
Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8c41d39ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/TurnRequestWaitQuery.ts
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 664512fec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 664512fec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 2baabd6 into lastcode/main Aug 24, 2026
@lastobelus
lastobelus deleted the lastcode/codex-thread-tools branch August 24, 2026 08:40
lastobelus added a commit that referenced this pull request Aug 24, 2026
Htulo needs one unattended LastCode update per day without password
prompts or repeated relaunches.

This adds one external 04:00 LaunchAgent controller. It stages and fully
prepares the newest Intel nightly at or below airy's installed version
before interrupting work, asks currently working htulo threads to pause
concurrently through the merged local thread CLI, checks once for
newcomers, quits once, swaps the user-owned app, attempts one launch,
and tells paused threads to resume. If any thread does not acknowledge,
the app stays running and already-paused threads are resumed.

The scheduled path never uses bootstrap mode. A one-time manual `run
--bootstrap` is documented for upgrading the currently installed pre-#52
app; after that, scheduled runs require the merged local thread wrapper.
Airy must have non-interactive SSH access enabled; otherwise staging
safely skips before changing pending state.

Focused validation: 25 controller/installer tests; scripts typecheck;
targeted lint, formatting, syntax, and diff checks. Normal pre-push
quick CI passed all workspaces.

Implemented with GPT-5.6 via the Codex harness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant